package com.springboot.model;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author TongRui
 * @since 2020-05-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "sys_statistics", autoResultMap = true)
public class SysStatistics extends Model<SysStatistics> {

    private static final long serialVersionUID=1L;

    @TableId(value = "id")
    private String id;

    private StatisticsTypeEnum type;

    @TableField(typeHandler = FastjsonTypeHandler.class)
    private JSONObject value;

    private Date lastTime;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}


